Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on load modules #888

Merged
merged 5 commits into from
Aug 10, 2020
Merged

Conversation

felippeefreire
Copy link
Contributor

WhatsApp has changed the way of encapsulating the modules. In this way, it works in both versions.

@mhndm
Copy link

mhndm commented Jun 4, 2020

if driver.is_connected() == False:

File "webwhatsapi/init.py", line 315, in is_connected
return self.wapi_functions.isConnected()
File "webwhatsapi/wapi_js_wrapper.py", line 44, in getattr
wapi_functions = dir(self)
File "webwhatsapi/wapi_js_wrapper.py", line 72, in dir
self.driver.execute_script(script.read())
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: SyntaxError: unexpected token: identifier

@lilachn
Copy link

lilachn commented Jun 29, 2020

I've used this PR, it fixed the issue I had with the window.Store.Msg, but now whenever I try to call get_unread() I'm getting cyclic object error. Downgrading to firefox 61 (I'm with 72) didn't work at all.

u```
ntu@ip-xxxxx-xxx:~/whatsapp/WebWhatsapp-Wrapper$ python3.7
Python 3.7.8 (default, Jun 29 2020, 05:46:05)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

from webwhatsapi import WhatsAPIDriver
driver = WhatsAPIDriver(username="mkhase")
driver.get_status()
'LoggedIn'
driver.get_unread()
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/init.py", line 411, in get_unread
raw_message_groups = self.wapi_functions.getUnreadMessages(
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/wapi_js_wrapper.py", line 44, in getattr
wapi_functions = dir(self)
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/wapi_js_wrapper.py", line 74, in dir
result = self.driver.execute_script("return window.WAPI")
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: Cyclic object value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants